package cn.chinaflame.pagodas.repository;

import cn.chinaflame.pagodas.entity.PaOrderitem;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PaOrderitemRepository extends JpaRepository<PaOrderitem, String> {

    @Query("select c from PaOrderitem c where c.orderId = ?1")
    public List<PaOrderitem> findByOrderId(String orderId, Sort sort);

    @Query("select c from PaOrderitem c where c.orderId = ?1")
    public List<PaOrderitem> findByOrderId(String orderId);
    
    @Query("select c from PaOrderitem c where c.orderId = ?1")
    public PaOrderitem findOrderItemById(String orderId);
}
